import os
from building import *

cwd = GetCurrentDir()

Import('asenv')
MODULES = asenv['MODULES']

objs = []

if('IFX' in MODULES):
    objs += Glob('Ifx/*.c')

if('FDT' in MODULES):
    objs += SConscript('libfdt/SConscript')

if('TRACE' in MODULES):
    objs += Glob('trace/*.c')
    asenv.Append(CPPPATH=['%s/trace'%(cwd)])

if('ARMNN' in MODULES):
    objs += SConscript('nn/armnn/SConscript')

if('LIBFIXMATH' in MODULES):
    AddPackage('https://github.com/autoas/libfixmath.git')

objs += Glob('ringbuffer/*.c')
asenv.Append(CPPPATH=['%s/ringbuffer'%(cwd)])

Return('objs')
